const KoaRouter = require('koa-router')

//自己写的
const {
	addFoods,
	modifyFoods,
	getAllFoods,
	deleteFoods,
	getFoods,
	getFood
} = require('../controller/foods.controller')

//实例化对象
const FoodsRouter = new KoaRouter({ prefix: '/foods' })

//编写路由
FoodsRouter.post('/addFoods',addFoods)
FoodsRouter.patch('/modifyFoods',modifyFoods)
FoodsRouter.get('/getAllFoods',getAllFoods)
FoodsRouter.post('/deleteFoods',deleteFoods)
FoodsRouter.post('/getFoods',getFoods)

FoodsRouter.get('/getFood',getFood)

module.exports = FoodsRouter